<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试一下</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
</head>
<body>
用户名：<input id="userCode" value="admin">
密码：<input id="password" type="password" value="123456789">
<input type="button" value="登录" id="test1">
<input type="button" value="退出" id="test2">
<input type="button" value="ceshi" id="test3">

<form action="/web/tbBaseFile/uploadFile" target="iframe" method="post" enctype="multipart/form-data" >
    <input type="file" name="file">
    <input type="submit" value="submit">
</form>
<iframe name="iframe" frameborder="0"></iframe>


</body>
<script  type="text/javascript">
    //window.location.href="./dist/index.html";
   $('#test1').click(function (){
        var data ={
            "userCode":$("#userCode").val(),
            "password":$("#password").val()
        }
        $.ajax({
            type:'POST',
            url:'/web/user/login',
            contentType: "application/json;charset=utf-8",
            dataType:'json',
            data : JSON.stringify(data),
            beforeSend:function(){

            },
            complete:function(response){
                let data=JSON.parse(response.responseText);
                if(data.success){
                    alert(data.msg);
                }else{
                    alert(data.msg)
                }
            }
        })
    })

    $('#test2').click(function (){
        var data ={
        }
        $.ajax({
            type:'POST',
            url:'/web/user/logout',
            contentType: "application/json;charset=utf-8",
            dataType:'json',
            data : JSON.stringify(data),
            beforeSend:function(){

            },
            complete:function(response){
                let data=JSON.parse(response.responseText);
                if(data.success){
                    alert(data.msg);
                }else{
                    alert(data.msg)
                }
            }
        })
    })

    $('#test3').click(function (){
        var data ={
        }
        $.ajax({
            type:'POST',
            url:'/web/menu/loadMenu',
            contentType: "application/json;charset=utf-8",
            dataType:'json',
            data : JSON.stringify(data),
            beforeSend:function(){

            },
            complete:function(response){
                alert(response.responseText);
                let data=JSON.parse(response.responseText);
                if(data.success){
                    alert(data.msg);
                }else{
                    alert(data.msg)
                }
            }
        })
    })
</script>
</html>